//---------------------------------------------------------------------------

#ifndef autoSFH
#define autoSFH
//---------------------------------------------------------------------------
#include <System.Classes.hpp>
#include <Vcl.Controls.hpp>
#include <Vcl.StdCtrls.hpp>
#include <Vcl.Forms.hpp>
#include "AdvToolBar.hpp"
#include "AdvToolBarStylers.hpp"
#include "AdvGrid.hpp"
#include "AdvObj.hpp"
#include "BaseGrid.hpp"
#include <Vcl.Grids.hpp>
#include <Data.DB.hpp>
#include <Data.Win.ADODB.hpp>
#include "AdvEdit.hpp"
#include "AdvGroupBox.hpp"
#include "AdvGlowButton.hpp"
//---------------------------------------------------------------------------
class Tautos : public TAdvToolBarForm
{
__published:	// IDE-managed Components
	TAdvToolBarOfficeStyler *advtlbrfcstylr1;
	TAdvToolBarPager *tb1;
	TAdvStringGrid *sgAuto;
	TADOQuery *qryAuto;
	TDataSource *dsAuto;
	TAdvGroupBox *grpBuses;
	TLabel *lbl1;
	TAdvEdit *edtNum;
	TAdvEdit *edtCarrier;
	TAdvEdit *edtRoute;
	TAdvEdit *edtType;
	TAdvEdit *edtModel;
	TAdvEdit *edtBNum;
	TAdvEdit *edtSIM;
	TAdvEdit *edtIMEI;
	TAdvGlowButton *btnAddBus;
	TAdvGlowButton *btnChange;
	TAdvGlowButton *btnDelBus;
	TLabel *lblInfo;
	TAdvGlowButton *btnSave;
	TAdvGlowButton *btnCancel;
	TComboBox *cbRoutes;
	TComboBox *cbCarriers;
	void __fastcall FormClose(TObject *Sender, TCloseAction &Action);
	void __fastcall FormShow(TObject *Sender);
	void __fastcall sgAutoSelectCell(TObject *Sender, int ACol, int ARow, bool &CanSelect);
	void __fastcall btnAddBusClick(TObject *Sender);
	void __fastcall edtNumChange(TObject *Sender);
	void __fastcall btnSaveClick(TObject *Sender);
	void __fastcall btnCancelClick(TObject *Sender);
	void __fastcall btnDelBusClick(TObject *Sender);
	void __fastcall btnChangeClick(TObject *Sender);
	void __fastcall edtBNumKeyPress(TObject *Sender, System::WideChar &Key);
	void __fastcall edtSIMKeyPress(TObject *Sender, System::WideChar &Key);
	void __fastcall edtIMEIKeyPress(TObject *Sender, System::WideChar &Key);

private:	// User declarations
public:		// User declarations
	__fastcall Tautos(TComponent* Owner);
	friend void __fastcall FillCombo(TComboBox *Combo,String db_table,bool bSort,String sFieldName,bool bClearBefore,bool bGroup);
    bool newbus;
	void __fastcall GetAutoList();
	void __fastcall GetBusParams(int ACol, int ARow);
	void __fastcall SaveBus();
	void __fastcall UpdBus();
};
//---------------------------------------------------------------------------
extern PACKAGE Tautos *autos;
//---------------------------------------------------------------------------
#endif
